package cz.anime.ppro.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the fragment database table.
 * 
 */
@Entity
public class Fragment implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

	@Temporal(TemporalType.DATE)
	private Date date;

	private String description;

	private String title;

	//bi-directional many-to-many association to Webuser
	@ManyToMany(mappedBy="fragments", fetch=FetchType.EAGER)
	private List<Webuser> webusers;

	//bi-directional many-to-one association to Content
	@OneToMany(mappedBy="fragment")
	private List<Content> contents;

	public Fragment() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public List<Webuser> getWebusers() {
		return this.webusers;
	}

	public void setWebusers(List<Webuser> webusers) {
		this.webusers = webusers;
	}

	public List<Content> getContents() {
		return this.contents;
	}

	public void setContents(List<Content> contents) {
		this.contents = contents;
	}

}